Exchange API
MCP Server
With the Exchange MCP server, your AI agent gains direct access to Exchange. From a simple conversation, the agent can search for assets, create assets, manage tags, and read reviews without requiring you to switch tabs or make manual API calls. It works with any MCP-compatible client. Connect once, and your AI agent knows what to call and when.
Supported Agent Actions
Once connected, you can ask your AI assistant to:
- Search Exchange for assets by name, type, or keyword
- Create a new asset and set its metadata
- Look up the full details of any asset
- Update or replace an asset's tags
- Read reviews for an asset version
- Check your Anypoint user profile
Authentication
The Exchange MCP server uses Anypoint Platform bearer tokens. Before setting up your AI client, obtain an access token.
Replace ANYPOINT_USERNAME and ANYPOINT_PASSWORD with your Anypoint credentials.
curl --location --request POST 'https://anypoint.mulesoft.com/accounts/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "ANYPOINT_USERNAME",
"password": "ANYPOINT_PASSWORD"
}' | jq -r ".access_token"Copy the token from the response and use it in these setup steps.
Token Expiry: Anypoint tokens are valid for 1 hour. You'll need to refresh your token periodically.
Connect Your AI Client
Claude Code
Quick Setup (Recommended)
Run this single command in your terminal. Replace YOUR_TOKEN with your Anypoint token.
claude mcp add --transport http exchange-mcp https://anypoint.mulesoft.com/exchange/mcp --header "Authorization: Bearer YOUR_TOKEN"Verify the connection:
claude mcp listYou should see an output like:
exchange-mcp: https://anypoint.mulesoft.com/exchange/mcp (HTTP) - ✓ ConnectedUnderstanding Configuration Scopes
Claude Code stores MCP servers in different locations depending on who should have access:
| Scope | Flag | Where It's Stored | Who Can Use It |
|---|---|---|---|
| Local (default) | --scope local | ~/.claude.json (per-project) | Only you, in this project |
| User | --scope user | ~/.claude.json | Only you, across all projects |
| Project | --scope project | .mcp.json in your repo | Anyone who clones this repo |
Examples:
# Add for this project only (default)
claude mcp add --transport http exchange-mcp https://anypoint.mulesoft.com/exchange/mcp --header "Authorization: Bearer YOUR_TOKEN"
# Add for all your projects
claude mcp add --scope user --transport http exchange-mcp https://anypoint.mulesoft.com/exchange/mcp --header "Authorization: Bearer YOUR_TOKEN"
# Add for your team (creates .mcp.json in repo)
claude mcp add --scope project --transport http exchange-mcp https://anypoint.mulesoft.com/exchange/mcp --header "Authorization: Bearer YOUR_TOKEN"What is .mcp.json?
When you add an MCP server with --scope project, Claude Code creates a .mcp.json file in your repository root. This file contains the MCP server configuration that gets shared with your team.
Example .mcp.json:
{
"mcpServers": {
"exchange-mcp": {
"type": "http",
"url": "https://anypoint.mulesoft.com/exchange/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}Security Note: The
.mcp.jsonfile contains your token. If sharing with a team, consider using environment variables or having each team member add their own token locally.
To manually create or edit .mcp.json:
- Create the file in your project root.
- Add your server configuration (see the previous format).
- Open the project in Claude Code and approve the server when prompted.
Useful Commands Reference
| Command | What It Does |
|---|---|
claude mcp list | Show all configured servers and their connection status |
claude mcp get <name> | Show details for a specific server (URL, headers, scope) |
claude mcp remove <name> | Remove a server |
claude mcp remove <name> --scope user | Remove from a specific scope |
Troubleshooting & FAQ
Connection Issues
"Failed to connect" status?
# 1. Check the server details.
claude mcp get exchange-mcp
# 2. Verify your token hasn't expired (tokens last 1 hour).
# Get a fresh token and update the server:
claude mcp remove exchange-mcp
claude mcp add --transport http exchange-mcp https://anypoint.mulesoft.com/exchange/mcp --header "Authorization: Bearer NEW_TOKEN"Server not appearing in claude mcp list?
# The server might be in a different scope. Check all locations:
cat ~/.claude.json | grep -A5 "mcpServers" # User/Local scope
cat .mcp.json 2>/dev/null # Project scopeToken Issues
"Authentication failed" or 401 errors?
Your token has expired. Get a new one:
# Get a fresh token
curl --location --request POST 'https://anypoint.mulesoft.com/accounts/login' \
--header 'Content-Type: application/json' \
--data-raw '{"username": "YOUR_USERNAME", "password": "YOUR_PASSWORD"}' | jq -r ".access_token"
# Update the server with the new token
claude mcp remove exchange-mcp
claude mcp add --transport http exchange-mcp https://anypoint.mulesoft.com/exchange/mcp --header "Authorization: Bearer NEW_TOKEN"Scope Confusion
"I added the server but it's not working in a different project"
You likely added it with local scope (the default). Add it with user scope instead:
claude mcp add --scope user --transport http exchange-mcp https://anypoint.mulesoft.com/exchange/mcp --header "Authorization: Bearer YOUR_TOKEN"Then commit the .mcp.json file to your repository.
Removing and Re-adding
Need to update the token or URL?
# Remove the existing server
claude mcp remove exchange-mcp
# Add it back with new settings
claude mcp add --transport http exchange-mcp https://anypoint.mulesoft.com/exchange/mcp --header "Authorization: Bearer NEW_TOKEN"Remove from a specific scope:
claude mcp remove exchange-mcp --scope user # Remove from user scope
claude mcp remove exchange-mcp --scope project # Remove from project scope (.mcp.json)
claude mcp remove exchange-mcp --scope local # Remove from local scopeQuick Checklist
If you encounter issues, use this checklist:
- Token is fresh (less than 1 hour old)
- Server URL is correct:
https://anypoint.mulesoft.com/exchange/mcp - Header format is correct:
Authorization: Bearer YOUR_TOKEN(note the space after "Bearer") - Transport is set to
http:--transport http - You're in the right project directory (for local/project scope)
Available Tools
| Tool | What it does |
|---|---|
search_assets | Search for an asset in Anypoint Exchange by name or other specified parameters. Returns the first asset that matches the input criteria. |
create_asset | Create assets in Anypoint Exchange. |
get_asset | Retrieve comprehensive details of an Exchange asset including all versions, metadata, categories, files, dependencies, and ratings. |
delete_asset | Remove all versions of an asset from Anypoint Exchange. |
delete_asset_version | Remove a specific version of an asset from Anypoint Exchange. |
get_asset_reviews | Retrieve reviews for an asset version. |
update_asset_tags | Update the tags for a specific asset. |
get_user_profile | Retrieve the profile of the currently authenticated user. |
Example Prompts
Once connected, try asking your AI agent:
- "Search Exchange for REST APIs related to customer management."
- "Create a new custom asset called 'Billing Notifications' with a description."
- "Get all the details for the asset with group ID
my-organd asset IDpayments-api." - "Show me the reviews for version 2.0.0 of the orders API."
- "Update the tags on the inventory API to include 'warehouse' and 'logistics'."